const { upperCaseFirst, slashToCamel } = require('../../utils')
const tpl = name => {
  const upperFirsNoSlash = upperCaseFirst(slashToCamel(name))
  return (`import { App } from 'vue'
import type { SFCWithInstall } from '@dex-ui/shared/types'
import ${upperFirsNoSlash} from './src/index.vue'

${upperFirsNoSlash}.install = (app: App): void => {
  app.component(${upperFirsNoSlash}.name, ${upperFirsNoSlash})
}

const _${upperFirsNoSlash}: SFCWithInstall<typeof ${upperFirsNoSlash}> = ${upperFirsNoSlash}

export default _${upperFirsNoSlash}
`)
}
module.exports = tpl
